<!doctype html>
<html ng-app="app">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="../../build/common/base.css" rel="stylesheet">
<script type="text/javascript" src="../../build/common/base.js"></script>
<script type="text/javascript" src="../../build/common/ngEdit.js"></script>
</head>
<script type="text/javascript">
	var app = angular.module('app', [ 'baseDirective' ]);
	app.controller("ctrl", [ '$scope', 'baseService',
			function($scope, baseService) {

			} ]);

	/* 获取URL表单的 JSON 数据  必须以 getData为方法名*/
	function getData() {
		return AngularUtil.getScope().data;
	}
	/* 获取URL表单的校验情况，必须以isValid 为方法名 */
	function isValid() {
		//校验表单 ab-validate的 校验
		if (!ngUtil.getScope().form.$valid) {
			$.Dialog.error("表单校验不通过！");
			return false;
		}

		// 您可以自由的去做特殊业务逻辑的校验
		return true;
	}
	
</script>
<body class="panel success" ng-controller="ctrl">
	<!-- 顶部按钮 -->
	<div class="panel-heading">
		<a class="btn btn-primary fa-shopping-cart" ng-model="data"  ab-save="/crm/goods/buy?id={id}&num={{data.num}}"> 购买 </a>
		<a href="javascript:void(0)" class="btn btn-sm btn-primary fa-reply" onclick="javascript:$.Dialog.close(window);"> 取消 </a>
	</div>
	<!--  ab-load 去controller 层获取业务数据  -->
	<form name="form" method="post" ab-load="crm/goods/get?id={id}"
		ng-model="data">

		<table class="form-table">
			<tbody>
				<tr>
					<th>商品名称</th>
					<td>{{data.name}}</td>
				</tr>
				<tr>
					<th>购买数量</th>
					<td><input type="text" class="form-control"
						ng-model="data.num"
						desc="购买数量" ab-validate="{required:true,digits:true}" /></td>
				</tr>
			</tbody>
		</table>
		
		
				
	</form>

</body>
















</html>